@extends('web.layouts.app')

@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/index.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/ucenter.css')}}">
@endsection

@section('content')
    <div class="uc-wrap swrap mt20">
        <div class="uc-side L">
            <div class="uc-nav">
                <ul>
                    @include('web.user_center.menu')
                </ul>
            </div>
        </div>
   	<div class="uc-main uc-mainbg R">
		<!--还款明细菜单选项-->
		<ul class="user-main-top-tab">
			<li><a href="{{ action('UserCenter\UserCenterController@generationCollection',['menu' => 6]) }}">待收款明细</a></li>
			<li class="active"><a href="{{ action('UserCenter\UserCenterController@alreadyCollection',['menu' => 6]) }}">已收款明细</a></li>
		</ul>
		<!--借款管理查询表单-->
		<div class="user-time-search ml20">
			<form method="get" action="{{ action('UserCenter\UserCenterController@alreadyCollection',['menu' => 6]) }}">
				<span>起止日期</span>
				<input type="text" name="startTime" value="{{ $query['startTime'] }}" class="date-txt Wdate" onclick="WdatePicker();"> -
				<input type="text" name="endTime" value="{{ $query['endTime'] }}" class="date-txt Wdate" onclick="WdatePicker();">
				<input type="submit" class="btn" value="搜索">
				<!-- <span class="speed-search">
					<a href="#">过去1个月</a>
					<a href="#">过去3个月</a>
					<a href="#">过去1年</a>
				</span> -->
			</form>
		</div>
		<!--资金项目展示-->
		<div class="user-rz-fund-items">
			<dl>
				<dt>笔数</dt>
				<dd><em>{{ $resources->count??0 }}</em></dd>
			</dl>
			<!-- <dl>
				<dt>收款金额</dt>
				<dd><em>{{ $resource->sumProfit??0 }}</em>元</dd>
			</dl> -->
			<dl>
				<dt>本金</dt>
				<dd><em>{{ $resources->sumMoney??0}}</em>元</dd>
			</dl>
			<dl>
				<dt>收益</dt>
				<dd><em>
					{{ $resources->sumProfit??0 }}
				</em>元</dd>
			</dl>
		</div>
		<!--列表-->
		<div class="user-item-list">
			<ul class="data-list shoukuan-list">
				<li class="th">
					<div class="col-name">项目名称</div>
					<div class="col-date">还款时间</div>
					<div class="col-method">还款方式</div>
					<div class="col-capital">本金(元)</div>
					<div class="col-interests">收益(元)</div>
				</li>
				@forelse($data as $d)
					<li>
						<div class="col-name">
							<a href="/oneProjects/{{$d->id}}">{{ $d->projects_name??'--' }}</a>
						</div>
						<div class="col-date">{{ $d->pay_time??'--' }}</div>
						<div class="col-method">{{ $d->name??'--' }}</div>
						<div class="col-capital">{{$d->money??'--'}}</div>
						<div class="col-interests">{{ $d->profit??'--' }}</div>
					</li>
				@empty
				@endforelse
			</ul>
			<div class="uc-page-box text-right">
				{{ $links }}
			</div>
		</div>

	</div>
</div>
@endsection

@section('scripts')
    <script src="{{ asset('resources/web/js/index.js') }}"></script>
	<script type="text/javascript" src="{{ asset('resources/web/plugins/datePicker/WdatePicker.js')}}"></script>
@endsection